home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 23
/
Amiga Format AFCD23 (Feb 1998, Issue 107).iso
/
-seriously_amiga-
/
shareware
/
graphics
/
autolwrender
/
execute.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1997-12-06
|
9KB
|
222 lines
/*******************************************************************************
** *
** AutoLWRendering. ARexx Script for Lightwave 3D v4.0+ *
** *
** $VER: Execute.rexx Rev. 1.1 (16 Jun 1995) *
** Rev. 1.1a(14 May 1996) *
** Rev. 1.2 (10 June 1996) *
** Rev. 1.2a(16 May 1997) *
** *
** The ARexx program restarts the rendering process beginning from the last *
** rendered frame after a black-out, a reboot or a Guru Meditation. *
** *
** This script requires LightWave3D v4 or higher and AmigaDOS 3.x. *
** It works fine also for LW v3.5 writing the proper path both for the Status *
** file and Lightwave main program. See below and read the manual of the pro- *
** gram for more details. *
** *
** Copyright © 1995-96 - Freely distributable - Not for commercial use! *
** This script is provided AS IS! No responsability or warranty of an *
** unsucceful result you can attribute to ME for its improper use! *
** *
** My address is: *
** *
** Angelo La Spina *
** CP 49 - 95013 Fiumefreddo (CT) *
** Italy - Tel. +39 347 6353119 *
** E-Mail: coming soon... *
** *
********************************************************************************
*
* Notes for using:
*
* First of all you must be sure that your LW-config configuration file is modi-
* fied in the right way. Edit the file and see below for details.
*
* This is a tipical LW-config configuration file (v4.x):
*
* LWCO
* 0
* ContentsDirectory Toaster:
* ScenesDirectory Scenes
* ObjectsDirectory Objects
* HierarchiesDirectory Scenes
* SurfacesDirectory Surfaces
* ImagesDirectory Images
* OutputDirectory Images
* FramestoresDirectory Framestore
* MotionsDirectory Motions
* EnvelopesDirectory Envelopes
* PreviewsDirectory Previews Note:
* StatusFilename LW-Status <--------- Insert here the name LW-Status.
* DefaultTension 0.000000 This file contains informations about
* DefaultSegmentMemory 2200000 the rendering in progress
* DefaultZoomFactor 3.200000
* DefaultOverlay 0
* FrameEndBeep 1
* RenderDisplayDevice 0
* RecordSetup1 (none)
* RecordSetup2 (none)
* RecordCommand (none)
* RecordDelay 0.000000
* FirstFrameDelay 0.000000
* DefaultLayoutGrid 4
* AutoKeyAdjust 0
* ExpertMode 0
* Plug-Ins.....etc...
*
* Save it over the old one.
*
* Now put the Execute ARexx script and its icon into WBStartup drawer and then
* reboot.If there are errors the script quits otherwise the parameters of your
* work will appear. Enter them and if it is all right the rendering (re)starts
* immediately.It's better the partition where all datas are stored shouldn't be
* formatted using Fast File System (in all variants) but using a more efficient
* and safe file system as Professional File System (PD available on Aminet) or
* Ami-FileSafe (which is commercial but a limited demo version is available on
* Aminet too). This ARexx script is free fully but any contribution is welcome
* for future improvements. Of course any bug report or comment is welcome too!
*
* Enjoy! Long life to Amiga and Lightwave 3D in all versions.
*
**********************************************************************************
*/
/*TRACE RESULTS*/
/*ADDRESS COMMAND 'sys:rexxc/tcc'*/
PRAGMA('D','TOASTER:')
IF EXISTS('ENVARC:Thelastframe') THEN DO /* This checks if last frame was */
OPEN('THELASTFRAME','ENVARC:Thelastframe',R) /* rendered. If not it goes over */
LF=COMPRESS((READLN(THELASTFRAME)),'"')
CLOSE('THELASTFRAME')
IF EXISTS(LF) THEN DO
ADDRESS COMMAND 'requestchoice "WARNING!" "All frames rendered! *n To restart a new work you must delete ALL rendered frames!" "EXIT"'
CALL ERROROUT
END
END
DO I=0 TO 1
IF EXISTS('ENVARC:SceneFilename') THEN DO
OPEN('FILESCENE1','ENVARC:SceneFilename','R')
FILESCENE=STRIP((READLN(FILESCENE1)),'B','"')
CLOSE('FILESCENE1')
IF FILESCENE='' THEN ADDRESS COMMAND 'DELETE >nil: ENVARC:SceneFilename';LEAVE
LEAVE
END
ELSE ADDRESS COMMAND 'requestfile title "Choose the Scene filename" positive "Choose" noicons >ENVARC:SceneFilename'
END
DO I=0 TO 1
IF EXISTS('ENVARC:ImagePrefix') THEN DO
OPEN('IMAGEPREFIX1','ENVARC:ImagePrefix','R')
IMAGEPREFIX=COMPRESS((READLN(IMAGEPREFIX1)),'"')
CLOSE('IMAGEPREFIX1')
IF IMAGEPREFIX='' THEN ADDRESS COMMAND 'DELETE >nil: ENVARC:ImagePrefix';LEAVE
LEAVE
END
ELSE ADDRESS COMMAND 'requestfile title "Enter the Image Prefix" positive "Enter" noicons >ENVARC:ImagePrefix'
END
DO I=0 TO 1
IF EXISTS('ENVARC:StartFrame') THEN DO
OPEN('STARTFRAME1','ENVARC:StartFrame','R')
STARTFRAME=COMPRESS((UPPER(READLN(STARTFRAME1))),':.-_,!£$%&()=?|~`''ì\èé+*ò@à#ù§><[]{}"/ABCDEFGHILMNOPQRSTUVZJKXYW')
CLOSE('STARTFRAME1')
IF STARTFRAME='' THEN ADDRESS COMMAND 'DELETE >nil: ENVARC:StartFrame';LEAVE
LEAVE
END
ELSE ADDRESS COMMAND 'requestfile title "Enter the number of the first frame" positive "Enter" noicons rejectpattern #? >ENVARC:StartFrame'
END
DO I=0 TO 1
IF EXISTS('ENVARC:EndFrame')=1 THEN DO
OPEN('ENDFRAME1','ENVARC:EndFrame','R')
ENDFRAME=COMPRESS((UPPER(READLN(ENDFRAME1))),':.-_,!£$%&()=?|~`''ì\èé+*ò@à#ù§><[]{}"/ABCDEFGHILMNOPQRSTUVZJKXYW')
CLOSE('ENDFRAME1')
IF ENDFRAME>999 THEN ENDFRAME=999
IF ENDFRAME<STARTFRAME THEN CALL ERROROUT
IF ENDFRAME='' THEN ADDRESS COMMAND 'DELETE >nil: ENVARC:EndFrame';LEAVE
LEAVE
END
ELSE ADDRESS COMMAND 'requestfile title "Enter the number of the last frame" positive "Enter" noicons rejectpattern #? >ENVARC:EndFrame'
END
DO I=0 TO 1
IF EXISTS('LW-STATUS') THEN DO
OPEN('LWSTATUS','LW-STATUS','R')
IF LWSTATUS='' THEN CALL ERROROUT
FRAME=WORD(READLN(LWSTATUS),1) /* This deletes two words starting from the */
CLOSE('LWSTATUS') /* second one to isolate the first frame number */
LEAVE
END
ELSE ADDRESS COMMAND 'requestfile title "Search the LW-Status file" positive "Choose" noicons >ENVARC:LWStatusPath'
END
/*
DO I=0 TO 1
IF EXISTS('ENVARC:LightwavePath') THEN DO
OPEN('LWPROGRAM1','ENVARC:LightwavePath','R')
LWPROGRAM=COMPRESS((READLN(LWPROGRAM1)),'"')
CLOSE('LWPROGRAM1')
IF LWPROGRAM='' THEN CALL ERROROUT
LEAVE
END
ELSE ADDRESS COMMAND 'requestfile title "Search the Lightwave 3D main program" positive "Choose" noicons #? >ENVARC:LightwavePath'
END
*/
SELECT
WHEN LENGTH(ENDFRAME)=1 THEN ENDFRAME='00'||ENDFRAME
WHEN LENGTH(ENDFRAME)=2 THEN ENDFRAME='0'||ENDFRAME
OTHERWISE CALL ERROROUT
END
OPEN('THELASTFRAME','ENVARC:Thelastframe',W) /* This writes a file which contains */
WRITELN('THELASTFRAME',IMAGEPREFIX||ENDFRAME) /* the full path of the last frame */
CLOSE('THELASTFRAME')
PRAGMA('D','TOASTER:PROGRAMS')
ADDRESS COMMAND STACK 55000
ADDRESS COMMAND 'run >nil: <nil: ' Lightwave.FP /* Here starts LW v.4 */
ADDRESS COMMAND WAIT 4 /* This is a pause of four seconds necessary until */
/* your startup-sequence will end. Change it if it */
/* is too short or long */
ADDRESS 'LightWaveARexx.port' /* Check LW ARexx Port */
ADDRESS COMMAND 'sys:rexxc/WaitForPort' 'LightWaveARexx.port'
LoadScene FILESCENE
SaveImages IMAGEPREFIX
IF FRAME>=STARTFRAME THEN STARTFRAME=FRAME
FirstFrame STARTFRAME
LastFrame ENDFRAME
Render 1 /* Starts rendering in automatic mode */
/* The following lines tell you that your work is completed */
IF EXISTS(LF) THEN DO
ADDRESS COMMAND 'requestchoice "WARNING!" "All frames rendered! *n To restart a new work you must delete ALL rendered frames!" "EXIT"'
ADDRESS COMMAND 'DELETE >nil: ENVARC:ImagePrefix ENVARC:StartFrame ENVARC:EndFrame ENVARC:SceneFilename'
CALL ERROROUT
END
ELSE ADDRESS COMMAND 'requestchoice "WARNING!" "Rendering Aborted!" "EXIT"'
CALL ERROROUT
ERROROUT:
CALL FREESPACE()
ADDRESS COMMAND 'sys:rexxc/rxc' /* This quits ARexx server */
/* and exit from program */
EXIT
RETURN